<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- React核心包 最先引入 提供一个对象React -->
  <script src="../react18/react.development.js"></script>
  <!-- React操作DOM的包 提供了一个对象 ReactDOM -->
  <script src="../react18/react-dom.development.js"></script>
  <!-- 引入Babel的包,用来解析JSX语法为JS语法 -->
  <script src="../react18/babel.min.js"></script>
</head>

<body>
  <div id="app"></div>
  <script type="text/babel">
    const game = ["Demon Soul","Dark Soul","Blood borne","Sekiro Die:twice","Elden Ring"]
    const isActive = true
    // 创建虚拟DOM
    const vDOM = (
      <ul className = {isActive?"active":""} style = {{color:"red",fontSize:"50px"}}>
        {
          game.map((item,index)=>{
            return <li>{item}</li>
          })
        }
      </ul>
    )

    ReactDOM.createRoot(document.getElementById("app")).render(vDOM)
  </script>
</body>

</html>